//
//  ListCell.m
//  BiologyLibrary
//
//  Created by 朱进 on 16/7/5.
//  Copyright © 2016年 youxh. All rights reserved.
//

#import "ListCell.h"

@implementation ListCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        
        CGFloat fOriginX = 20;
        CGFloat fOriginY = 5;
        CGFloat fDistanceX = 5;
        CGFloat fWidthRight = 70;
        CGFloat fWidthLeftView = fWidth_Current - fOriginX * 2 - fWidthRight - fDistanceX;
        CGFloat fHeightLabel = g_fHeight_ListCell - fOriginY * 2;
        
        UIView *backgroudView = [[UIView alloc] initWithFrame:
                                 CGRectMake(fOriginX - 10, fOriginY,
                                            fWidth_Current - fOriginX * 2 + 20,
                                            g_fHeight_ListCell - fOriginY * 2)];
        backgroudView.backgroundColor = [UIColor colorWithRed:0.15 green:0.19 blue:0.24 alpha:1];
        [self.contentView addSubview:backgroudView];

        UILabel *titleLabel_ = [[UILabel alloc] initWithFrame:
                                 CGRectMake(fOriginX, fOriginY, fWidthLeftView, fHeightLabel)];
        titleLabel_.backgroundColor = [UIColor clearColor];
        titleLabel_.font = [UIFont flatFontOfSize:g_fSize_AppFont];
        titleLabel_.textColor = [UIColor whiteColor];
        titleLabel_.text = @"";
        [self.contentView addSubview:titleLabel_];
        self.titleLabel = titleLabel_;
        
        UILabel *statusLabel_ = [[UILabel alloc] initWithFrame:
                                CGRectMake(titleLabel_.frame.origin.x + titleLabel_.frame.size.width + fDistanceX,
                                           titleLabel_.frame.origin.y,
                                           fWidthRight,
                                           fHeightLabel)];
        statusLabel_.backgroundColor = [UIColor clearColor];
        statusLabel_.font = [UIFont flatFontOfSize:g_fSize_AppFont - 3];
        statusLabel_.textColor = [UIColor lightGrayColor];
        statusLabel_.textAlignment = NSTextAlignmentCenter;
        statusLabel_.text = @"";
        [self.contentView addSubview:statusLabel_];
        self.statusLabel = statusLabel_;
    }
    
    return self;
}

@end
